<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="MvcContrib.FluentHtml.ModelViewPage<Universum.Model.Domain.Blogs.BlogArticle>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Edit
</asp:Content>
<asp:Content ID="BreadcrumbsContent" ContentPlaceHolderID="Breadcrumbs" runat="server">
<%= Html.Breadcrumb().Home().Append<BlogsController>(c => c.Index(), "Posts from "+ ( Model.Username?? "blog" )).AppendText("Edit: " + Model.Title).End()%>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Edit</h2>

    <%= Html.ValidationSummary("Edit was unsuccessful. Please correct the errors and try again.") %>
	
	<% using(Html.BeginForm<BlogArticleController>( controller=>controller.Remove(this.Model.ID), FormMethod.Post)){ %>
	<%= this.SubmitButton("Remove post") %>
	<% } %>
	
    <% using (Html.BeginForm < BlogArticleController >(controller=>controller.Edit(Model.ID))){%>

        <fieldset>
            <legend>Fields</legend>
           
           <p>
            <%= this.TextBox( model => model.Title).Size(100).Label("Title") %>
               
                <%= this.ValidationMessage( model => model.Title, "*") %>
            </p>
           <p>
            <%= this.TextArea( model => model.Text).Styles( width=>"100%" ).Label("Text") %>
               
                <%= this.ValidationMessage( model => model.Text, "*") %>
            </p>
           <p>
            <%= this.TextBox( model => model.Publish).Class("date").Label("Publish") %>
               
                <%= this.ValidationMessage( model => model.Publish, "*") %>
            </p>
          
            <p> 
              <%= this.Hidden( model => model.ID) %>
                <%= this.SubmitButton("Save") %> or 
               <%Html.BeginLink<BlogsController>(it => it.Index()); %>
  Cancel
  <%Html.EndLink(); %>
            </p>
        </fieldset>

    <% } %>

   
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="ScriptPlaceHolder" runat="server">
<% Html.RenderPartial("EditorAndDateUserControl"); %>
</asp:Content>

